home *** CD-ROM | disk | FTP | other *** search
- /* Standard C Include files */
- /* #include "CType.h" */
- /* #include "ErrNo.h" */
- /* #include "FCntl.h" */
- /* #include "IOCtl.h" */
- /* #include "Math.h" */
- /* #include "SetJmp.h" */
- /* #include "Signal.h" */
- /* #include "StdIO.h" */
- /* #include "String.h" */
-
- /* Primary Interface Files */
- #include "Types.h"
- #include "Resources.h"
- #include "Quickdraw.h"
- /* #include "Windows.h" */
- /* #include "OSUtils.h" */
-
- /* Commonly Included files */
- /* #include "ToolUtils.h" */
- #include "TextEdit.h"
- /* #include "Controls.h" */
-
- /* Other Interface files */
- /* #include "AppleTalk.h" */
- /* #include "CursorCtl.h" */
- /* #include "Desk.h" */
- /* #include "DeskBus.h" */
- /* #include "Devices.h" */
- #include "Dialogs.h"
- /* #include "DiskInit.h" */
- /* #include "Disks.h" */
- /* #include "ErrMgr.h" */
- #include "Errors.h"
- /* #include "Events.h" */
- #include "Files.h"
- /* #include "Fonts.h" */
- /* #include "Graf3D.h" */
- /* #include "Lists.h" */
- #include "Memory.h"
- /* #include "Menus.h" */
- #include "Packages.h"
- /* #include "Palette.h" */
- /* #include "Perf.h" */
- /* #include "Picker.h" */
- /* #include "Printing.h" */
- /* #include "Retrace.h" */
- /* #include "ROMDefs.h" */
- /* #include "SANE.h" */
- #include "Scrap.h"
- /* #include "Script.h" */
- /* #include "SCSI.h" */
- /* #include "SegLoad.h" */
- /* #include "Serial.h" */
- /* #include "Slots.h" */
- /* #include "Sound.h" */
- /* #include "Start.h" */
- /* #include "Strings.h" */
- /* #include "Time.h" */
- /* #include "Traps.h" */
- /* #include "Values.h" */
- /* #include "VarArgs.h" */
- /* #include "Video.h" */
-
- /* Application-specific Include files */
- #include "::TiffLibrary:TIFFLib.h"
- #include "sample.h"
- #include "messages.h"
-
- struct {
- unsigned char length;
- unsigned char text[1];
- } noString = {
- 0,
- ""
- };
-
- void ErrorMessage(stringResourceID)
- Int16 stringResourceID;
- {
- Handle strHandle;
-
- strHandle = GetResource('STR ', stringResourceID);
- if (ResError() != noErr)
- return;
- if (strHandle == nil) {
- LoadResource(strHandle);
- if (ResError() != noErr)
- return;
- }
- HLock(strHandle);
- PARAMTEXT(&(**strHandle), &noString, &noString, &noString);
- HUnlock(strHandle);
- Alert(ERRORALERT, nil);
- }
-
- Ptr MyNewPtr(size)
- Int32 size;
- {
- Ptr p;
- p = NewPtr(size);
- if (MemError() != noErr) {
- ErrorMessage(BADMEMORY);
- p = nil;
- }
- return(p);
- }
-
- Handle MyNewHandle(size)
- Int32 size;
- {
- Handle p;
- p = NewHandle(size);
- if (MemError() != noErr) {
- ErrorMessage(BADMEMORY);
- p = nil;
- }
- return(p);
- }
-
- void MyDisposPtr(pPtr)
- Ptr *pPtr;
- {
- if (*pPtr != nil)
- DisposPtr(*pPtr);
- *pPtr = nil;
- }
-
- void MyDisposHandle(pHandle)
- Ptr *pHandle;
- {
- if (*pHandle != nil)
- DisposPtr(*pHandle);
- *pHandle = nil;
- }
-
- #ifdef DEBUG
- void DebugMessage(pFormat, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
- register char *pFormat; /* pointer to printf format string */
- long arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7;
- {
- register char *p;
- register int i;
- static Str255 DbgString;
-
- sprintf(DbgString.text, pFormat, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- DbgString.length = strlen(DbgString.text);
- PARAMTEXT(&DbgString, &noString, &noString, &noString);
- Alert(ERRORALERT, nil);
- }
- #endif
-